package com.pompom.matchcrawler;

public class ResponseTypeChecker {

	public static final int
	NO_ERROR=0,
	MATCH_NOT_FOUND=1,
	PRACTICE_MATCH=2;
	
	
	public static int checkResponse(String response)
	{
		int ret = NO_ERROR;
		
		if (response.contains("error"))
		{
			if (response.contains("Match ID not found")|| response.contains("No Match ID specified"))
				return MATCH_NOT_FOUND;
			else if (response.contains("Practice matches are not available"))
				return PRACTICE_MATCH;
			
		}
		else if (response.contains("players"))
			return NO_ERROR;
		
		return ret;
		
	}


}
